Project(SnowflakeSDK)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)

SET (CMAKE_MODULE_LINKER_FLAGS "/DEBUG ${CMAKE_MODULE_LINKER_FLAGS_INIT}")
SET (CMAKE_EXE_LINKER_FLAGS "/DEBUG ${CMAKE_EXE_LINKER_FLAGS_INIT}")
SET (CMAKE_SHARED_LINKER_FLAGS "/DEBUG ${CMAKE_SHARED_LINKER_FLAGS_INIT}")

ADD_DEFINITIONS(/D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(/DNUI_RELEASE_MAJOR_VER=3)
ADD_DEFINITIONS(/DNUI_RELEASE_MINOR_VER=0)
ADD_DEFINITIONS(/DNUI_APPDATA_FOLDER="/Natural User Interface Technologies AB/")

SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)

IF(WIN32)
	FILE(GLOB LIBRARY_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/extern/*/lib)
	FILE(GLOB INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/extern/*/include ${CMAKE_CURRENT_SOURCE_DIR}/extern/*)
	INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
	INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/extern/Blobz/include/GLee)
	LINK_DIRECTORIES(${LIBRARY_DIRS})
	SET(APP_LIBRARIES_WINDOWS opengl32.lib)
ENDIF(WIN32)

FIND_PACKAGE(Qt4 4.7.0 REQUIRED)
SET(QT_USE_QTMAIN TRUE)
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTOPENGL TRUE)
SET(QT_USE_QTXML TRUE)
SET(QT_USE_QTWEBKIT TRUE)
SET(QT_USE_PHONON TRUE)
LINK_DIRECTORIES(${QT_LIBRARY_DIR})
INCLUDE(${QT_USE_FILE})

# root directory for moc-ed Qt .h files (Qt Designer)
SET(NUI_BUILD_PROJECTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build/projects)

# Set INSTALL targets
SET(NUI_APP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin/applications)
SET(NUI_BIN_DIR_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/bin/debug)
SET(NUI_BIN_DIR_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/bin/release)

SET(CMAKE_DEBUG_POSTFIX "_d")

# Add projects
ADD_SUBDIRECTORY(projects/executable)